Repository navigation
feat(plugin-security): a host can keep a platform baseline contribution at read, or decline it - #33444
Conversation
…on at read, or decline it SecurityPlugin takes platformBaselineOverrides, keyed by contributed set name and object: 'read' keeps the object's read and withholds its create, 'decline' withholds the object. It is applied inside the platform baseline seam where a contribution is admitted, so every reader of the set reads the narrowed body. It only takes bits away; a set left granting nothing joins no baseline; an override that matched nothing by kernel:bootstrapped is warned. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cz2MxDkQYCC4U8indM
📓 Docs Drift CheckThis PR changes 1 package(s): 2 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
What this run could not see
Coarse fallback — 18 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 54623d7bad6584ca43e4590ebc4cf56dae81add8 && git checkout 54623d7bad6584ca43e4590ebc4cf56dae81add8
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 0e9ff949cb4bd2bb51716c4154e36699bd6d3a55 343d6cc1fc5ceae7e5acb931382c529d51bb0e52 && git checkout -B drift-repro 0e9ff949cb4bd2bb51716c4154e36699bd6d3a55 && git merge --no-ff 343d6cc1fc5ceae7e5acb931382c529d51bb0e52
node scripts/docs-audit/affected-docs.mjs --json 0e9ff949cb4bd2bb51716c4154e36699bd6d3a55
|
|
Contract-review-claim: session_016WV4d1PGptBW3QRQNmy5e6 · head ea806b4 · 2026-11-14T21:21:53Z review#3. |
Contract reviewServed-tier: ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: FAIL |
…s a widening, and say a declined set holds no name Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cz2MxDkQYCC4U8indM
…leaves Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cz2MxDkQYCC4U8indM
|
Contract-review-claim: session_016WV4d1PGptBW3QRQNmy5e6 · head 4ebb712 · 2026-11-14T21:26:32Z review#3 (delta). |
Contract reviewServed-tier: This is the delta ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
|
domain:server#5 · os-elon-musk · session_016WV4cz2MxDkQYCC4U8indM ACCEPT: head 343d6cc
Landing: ready for review, then auto-merge (area rule for PRs that passed review, 2026-11-14T22:54Z). |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 43655916437 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
|
domain:server#5 · os-elon-musk · session_016WV4cz2MxDkQYCC4U8indM Queue triage for build 43655916437, 2026-11-15T00:16Z: this ejection is not this PR's.
|
Requested by Elon · project thread
Fixes #33132
Clause-②: yes (widening) —
SecurityPluginaccepts a new, opt-in option,platformBaselineOverrides, and the package exports two new types,PlatformBaselineOverrideandPlatformBaselineOverrides. Omitted, every platform baseline contribution is admitted as contributed, as before.Metadata-protocol: none
Maintainer quick read
SecurityPluginconfiguration, "members keep reading attachments but may not create them" (or withhold a platform service's grant entirely). Before, cloud had to wrap an internal security-service function to get this, and a rename of that function would have silently dropped the protection.storage_attachment_member: read and create onsys_attachment) on every member's baseline. Cloud's control plane is cross-tenant and must not let an organization administrator create attachments there.packages/plugins/plugin-security/src/platform-baseline-sets.ts(readPlatformBaselineOverridesOption,applyOverrides,unmatchedOverrides).pnpm --filter @objectstack/plugin-security exec vitest run src/platform-baseline-sets.What changes
SecurityPluginOptions.platformBaselineOverrides(new): contributed set name → object →'read'(keep read, withhold create) or'decline'(withhold the object). Example:{ storage_attachment_member: { sys_attachment: 'read' } }. A malformed declaration (non-object, empty set name, a set entry naming no object, object'*', a verdict other than'read'/'decline') is refused when the plugin is constructed.platform-baseline-sets.ts:PlatformBaselineSetstakes the overrides. Incontribute, the contribution is first held to every existing seam rule as the contributor wrote it, and only then narrowed. An override never adds a bit:'read'on an object the set grants create only withholds that object.security/explain, the effective-access read and theeveryoneanchor all read it.joined: false, the answer a no-baseline deployment already gives).unmatchedOverrides()lists entries no admitted contribution matched.security-plugin.ts: atkernel:bootstrapped, each unmatched override is logged atwarn, naming it, so a renamed set or object is said rather than silently left in force.security-plugin-security-service.ts: the admission line appends what the host narrowed, and its meta carriesoverridden. Without overrides the line is byte-identical to today's (the existing integration pin still passes unchanged).index.ts: exports thePlatformBaselineOverride/PlatformBaselineOverridestypes for hosts.content/docs/permissions/attachments-access.mdx: documents the option under "Who holds the object grant".@objectstack/plugin-securitypatch,Clause-②: yes (widening)(review#3 M1).Tests
platform-baseline-sets.test.ts(unit):'read'narrows and the narrowed body is registered;'decline'on one of two objects keeps the other; a fully declined set is not registered and joins nothing;'read'never adds read; a contribution the seam refuses is still refused with an override present; unmatched overrides are reported; no override leaves the contribution as is; five malformed declarations refused.platform-baseline-sets.integration.test.ts(real kernel, card acceptance): with{ pbs_notes_member: { pbs_note: 'read' } }, the set still joins, a member reads the object, a member's create is refused 403 andexplainsays create is not allowed, the catalog holds read on / create off, the admission line names the narrowing, and an override naming an uncontributed set is warned once at boot.Verification
pnpm --filter @objectstack/plugin-security exec vitest run: 267 files / 6671 tests passed (45 skipped).tsc --noEmitontsconfig.jsonandtsconfig.test.json: clean. ESLint on the touched files: clean.Human Minimum
packages/specholds no runtime logic.pnpm lintpasses.main, one pull request.packages/specis not touched.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_016WV4cz2MxDkQYCC4U8indM